package com.yyk.yiliao.ui.mine.activity;

import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.yyk.yiliao.R;
import com.yyk.yiliao.base.BaseActivity;
import com.yyk.yiliao.base.BaseRecyclerAdapter;
import com.yyk.yiliao.base.BaseRecyclerHolder;
import com.yyk.yiliao.bean.Usehelp_Info;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 使用帮助
 */
public class Usehelp_Activity extends BaseActivity {

    @BindView (R.id.mUsehelp_rv)
    RecyclerView mUsehelpRv;
    private BaseRecyclerAdapter<Usehelp_Info> adapter;
    private List<Usehelp_Info>                usehelpList;
    private String title[]   = {"问：云医康预约挂号如何收费？", "问：云医康预约挂号是否有数量限制？", "问：云医康预约挂号需要哪些证件信息？","问：云医康预约挂号与医院现场挂号有何区别？"};
    private String content[] = {"云医康站内各医院均已开通在线支付功能，具体预约挂号费用以医院收费情况为准，云医康不参与相关的费用制定。",
            "为防止黄牛恶意刷号，云医康针对预约挂号设有数量限制，每一账户每月内可预约挂号10次，超过预约挂号次数建议您次月再进行在线预约挂号操作。",
            "应国家卫计委要求，在线预约挂号必须进行实名认证，请您在完善相关资料后进行操作，目前阶段仅需要您提供中华人民共和国二代身份证件相关信息即可进行在线预约挂号。",
            "在互联网时代，在线预约挂号可以极大地节省您在现场排号所耗费的时间与经历，方便您更加合理的安排个人行程。"};



    @Override
    public int getLayoutId() {
        return R.layout.activity_usehelp;
    }


    public void initView() {
        initToolbar();
    }

    private void initToolbar() {
        setBackArrow();
        setTitle("使用帮助");
    }

    @Override
    public void initData() {
        usehelpList = new ArrayList<>();
        for (int i = 0; i < title.length; i++) {
            Usehelp_Info usehelp_info = new Usehelp_Info();
            usehelp_info.setTitle(title[i]);
            usehelp_info.setContent(content[i]);
            usehelpList.add(usehelp_info);
        }
        initAdapter();

    }

    private void initAdapter() {
        adapter = new BaseRecyclerAdapter<Usehelp_Info>(Usehelp_Activity.this, usehelpList, R.layout.adapter_item_usehelp) {
            @Override
            public void convert(BaseRecyclerHolder holder, Usehelp_Info item, int position, boolean isScrolling) {
                holder.setText(R.id.nUsehelp_title, item.getTitle());
                holder.setText(R.id.nUsehelp_content, item.getContent());
            }
        };
        mUsehelpRv.addItemDecoration(new DividerItemDecoration(Usehelp_Activity.this, DividerItemDecoration.VERTICAL));
        mUsehelpRv.setLayoutManager(new LinearLayoutManager(Usehelp_Activity.this.getApplicationContext(), LinearLayoutManager.VERTICAL, false));
        mUsehelpRv.setAdapter(adapter);
    }
}
